#include "../Util/leds.h"

void initLed()
{
    TRISBbits.RB0 = 0;
    ANSELBbits.ANSB0 = 0;
    TRISBbits.RB1 = 0;
    ANSELBbits.ANSB1 = 0;
    TRISBbits.RB2 = 0;
    ANSELBbits.ANSB2 = 0;
    TRISBbits.RB3 = 0;
    ANSELBbits.ANSB3 = 0;
}

void allumerLed(char num)
{
	switch(num)
	{
	case 1: LATBbits.LATB0 = 1;
	break;
	
	case 2: LATBbits.LATB1 = 1;
	break;
	
	case 3: LATBbits.LATB2 = 1;
	break;
	
	case 4: LATBbits.LATB3 = 1;
	break;
	
	default :
            LATBbits.LATB0 = 1;
            LATBbits.LATB1 = 1;
            LATBbits.LATB2 = 1;
            LATBbits.LATB3 = 1;
        break;
	}
}

void eteindreLed(char num)
{
	switch(num)
	{
	case 1: LATBbits.LATB0 = 0;
	break;
	
	case 2: LATBbits.LATB1 = 0;
	break;
	
	case 3: LATBbits.LATB2 = 0;
	break;
	
	case 4: LATBbits.LATB3 = 0;
	break;
	
	default : 
            LATBbits.LATB0 = 0;
            LATBbits.LATB1 = 0;
            LATBbits.LATB2 = 0;
            LATBbits.LATB3 = 0;
            break;
	}
}